<h2>Admin menu</h2>

<div id="ajax-response">
<?php 
if(!isset($_SESSION)) session_start();
if(isset($_SESSION['notification'])){
	echo implode(' <br/> ',$_SESSION['notification']);
	unset($_SESSION['notification']);
}
?>
</div>

<form class="search-form" method="post" accept-charset="utf-8" action="">
<p class="search-box">
	<input name="search_categories" value="" id="tag-search-input" type="text">
	<input value="Rechercher Rubrique" type="submit">
</p>
</form>
<br class="clear">

<div id="col-container">

<div id="col-right">
<div class="col-wrap">
<form id="posts-filter" method="post" accept-charset="utf-8" action="">
<table  class="wp-list-table widefat fixed tags">
	<thead>
		<tr>
			<th class="manage-column column-0 check-column" id="0" scope="col">
			</th>
			<th class="manage-column column-name sortable desc" id="name" scope="col">
				<a href="#name"><span>Nom</span><span class="sorting-indicator"></span></a></th>

			<th class="manage-column column-slug sortable desc" id="slug" scope="col">
				<a href="#href"><span>URL</span><span class="sorting-indicator"></span></a></th>

			<th class="manage-column column-option sortable desc" id="option" scope="col">

				<a href="#option"><span>Class</span><span class="sorting-indicator"></span></a>
             </th>
			<th class="manage-column column-count sortable desc" id="count" scope="col">
				<a href="#count"><span>Icon</span><span class="sorting-indicator"></span></a>
			</th>
		</tr>
	</thead>

	<tfoot>
		<tr>
			<th class="manage-column column-0 check-column" id="0" scope="col">
			</th>
			<th class="manage-column column-name sortable desc" id="name" scope="col">
				<a href="#name"><span>Nom</span><span class="sorting-indicator"></span></a></th>

			<th class="manage-column column-slug sortable desc" id="slug" scope="col">
				<a href="#href"><span>URL</span><span class="sorting-indicator"></span></a></th>

			<th class="manage-column column-option sortable desc" id="option" scope="col">
				<a href="#option"><span>Class</span><span class="sorting-indicator"></span></a></th>

			<th class="manage-column column-count sortable desc" id="count" scope="col">
				<a href="#count"><span>Icon</span><span class="sorting-indicator"></span></a>
			</th>
		</tr>
	</tfoot>

	<tbody data-wp-lists="list:tag" id="the-list">
	<?php
	$url=$CFG->config['base_url'];
	foreach($tableItemBody as $row){
		$id=$row->id;
		$subCategory='';
		if($row->parent) $subCategory='└─';
			echo "
			<tr class='alternate' id='tag-$id'>
				<th class='check-column' scope='row'>
					<a href='{$url}setting/adminMenu/up/$id' > &#x25B4; </a> <a href='{$url}setting/adminMenu/down/$id' > &#x25BE; </a>
				</th>
				<td class='name column-name'><strong>$subCategory<a title='Edit à {$row->name}' href='edit/$id' class='row-title'>{$row->name}</a></strong><br>
					<div class='row-actions'>
						<span class='inline hide-if-no-js editinlineAdminMenu'> Edition rapide | </span>
						<span class='delete'><a href='{$url}setting/adminMenu/delete/$id' class='delete-tag'>Supprimer</a> | </span>
					</div>
					<div id='inline_$id' class='hidden'>
						<div class='name'>{$row->name}</div>
						<div class='href'>{$row->href}</div>
						<div class='parent'>{$row->parent}</div>
						<div class='class'>{$row->class}</div>
						<div class='icon'>{$row->icon}</div>
					</div>
				</td>
				<td class='href column-href'>{$row->href}</td>
				<td class='class column-class'>{$row->class}</td>
				<td class='icon column-icon'>{$row->icon}</td>
			</tr>";
			}
	?>
	</tbody>
</table>
	
<br class="clear">
</form>

<div class="form-wrap">
<p>&nbsp;</p>
</div>

</div>
</div><!-- /col-right -->

<div id="col-left">
<div class="col-wrap">


<div class="form-wrap">
<input type="submit" value="Ajouter Nouvelle Rubrique" class="button button-primary" id="submit" name="Add_AdminMenu">
<form class="validate" action="" method="post" id="addtag">
  <div class="form-field form-required">
	<label for="tag-name">Rubrique
:</label>
	<input type="text" aria-required="true" size="40" value="" id="tag-name" name="name">
  </div>
<div class="form-field">
	<label for="tag-slug">URL :</label>
	<input type="text" size="40" value="" id="tag-slug" name="href">
	<p>Le "Slug" est l'URL efficace. Il est g&eacute;n&eacute;ralement en minuscules et contient uniquement des lettres, des chiffres et des traits d'union.</p>
</div>
<div class="form-field">
	<label for="tag-parent">Parent Menu Admin:</label>
	<select class="postform" id="tag-parent" name="parent">
		<option value="0">Aucun</option>
		<?php echo $option_menu?>
	</select>
</div>

<div class="form-field">
	<label for="tag-class">Class :</label>
	<input class="postform" type="text" size="40" value="" id="tag-class" name="class">
	<p> Nom de class :</p>
</div>


<div class="form-field">
	<label for="tag-icon">Icon :</label>
	<input class="postform" type="text" size="40" value="" id="tag-icon" name="icon"/>
	<p> Nom d'image icon : </p>
</div>

<div class="form-field">
	<label for="tag-description">Survol :</label>
	<textarea class="postform" cols="40" rows="5" id="tag-description" name="tilte"></textarea>
	<p>La description sur vol item</p>
</div>

<p class="submit">
	<input type="submit" value="Ajouter Nouvelle Rubrique" class="button button-primary" id="submit" name="Add_AdminMenu">
</p>
</form>
</div>

</div>
</div><!-- /col-left -->

</div><!-- /col-container -->
</div><!-- /wrap -->

	<table style="display: none">
	<tbody id="inlineedit">
		<tr style="display: none" class="inline-edit-row" id="inline-edit">
		<td class="colspanchange" colspan="5">

		<form action="" method="post">
			<fieldset>
			<div class="inline-edit-col">
				<h4>Edition Rapide</h4>

				<label>
					<span class="title">Nom</span>
					<span class="input-text-wrap"><input id="tag-name" type="text" value="" class="name" name="name" onchange="$(this).parents('form').find('#tag-slug').val(convert_accent(this.value));checkUrl(url_friendly)"></span>
				</label>
				<p class="clear"/>
				<label>
					<span class="title">Href</span>
					<span class="input-text-wrap"><input id="tag-href" type="text" value="" class="href" name="href"/></span>
				</label>
				<p class="clear"/>
				<label>
					<span class="title">Parent</span>
					<span class="input-text-wrap">
						<select class="parent" id="tag-parent" name="parent">
							<option value="0">Aucun</option>
							<?php echo $option_menu?>
						</select>
					</span>
				</label>
				<p class="clear"/>
				<label>
					<span class="title">Class</span>
					<span class="input-text-wrap"><input id="tag-class" type="text" value="" class="class" name="class"/></span>
				</label>
				<p class="clear"/>
				<label>
					<span class="title">Icon</span>
					<span class="input-text-wrap"><input id="tag-icon" type="text" value="" class="icon" name="icon"/></span>
				</label>
			</div>
			</fieldset>
	
		<p class="inline-edit-save submit">
			<button class="cancel button-secondary alignleft" title="Cancel" accesskey="c">Cancel</button>
			<button class="save button-primary alignright" name="Update_AdminMenu"  value="Update_AdminMenu" type="submit" accesskey="s">Update Menu</button>
			<span class="spinner"></span>
			<input type="hidden" value="" name="id"/>
			<br class="clear"/>
		</p>
		</form>
		</td>
		</tr>
		</tbody></table>
	

<div class="clear"></div>